using UnityEditor;
using UnityEngine;
using System.Collections.Generic;
// using Sirenix.OdinInspector.Editor;
using Sirenix.Utilities;
using Sirenix.Utilities.Editor;

public class EditorMenus
{
    [MenuItem("UI/GenUIEditor")]
    public static void ShowWindow()
    {
        GeneratorUIEditor window = (GeneratorUIEditor)EditorWindow.GetWindow(typeof(GeneratorUIEditor));
        window.position = new Rect(0, 0, 800, 600);
    }

    [MenuItem("Tools/UIEditor")]
    private static void OpenWindow()
    {
        var window = EditorWindow.GetWindow<UIEditor>();
        window.position = GUIHelper.GetEditorWindowRect().AlignCenter(800, 500);
    }

    [MenuItem("Assets/Create/UI/生成选中的UI预制体代码", false, 0)]
    private static void CreateUIPrefabCode()
    {
        UIGeneratorMgr.Instance.GenerateUIPrefabCode();
    }

    [MenuItem("Assets/Create/UI/生成选中的UI预制体代码包含命名空间", false, 0)]
    private static void CreateUIPrefabCodeWidthNameSpace()
    {
        UIGeneratorMgr.Instance.GenerateUIPrefabCode(false,true);
    }

    [MenuItem("Assets/Create/UI/生成选中的UIItem预制体代码", false, 0)]
    private static void CreateUIItemPrefabCode()
    {
        UIGeneratorMgr.Instance.GenerateUIPrefabCode(true,false);
    }

    [MenuItem("Assets/Create/UI/生成选中的UIItem预制体代码包含命名空间", false, 0)]
    private static void CreateUIItemPrefabCodeWidthNameSpace()
    {
        UIGeneratorMgr.Instance.GenerateUIPrefabCode(true,true);
    }

    [MenuItem("Tools/创建字体(sprite)")]
    public static void Open()
    {
        EditorWindow.GetWindow<CreateFont>("创建字体");
    }

    [MenuItem("Tools/Proto/生成所有proto文件")]
    public static void GenerateAllProtoFile()
    {
        ProtoGenerator.Instance.GenerateAllProtoFile();
    }

    [MenuItem("Tools/Proto/生成修改的或新添的proto文件")]
    public static void CheckOutWithConvertProtoFile()
    {
        ProtoGenerator.Instance.CheckOutWithConvertProtoFile();
    }

    [MenuItem("Tools/SystemModules")]
    static void OpenSysTemWindow()
    {
        SystemMgrEditor window = (SystemMgrEditor)EditorWindow.GetWindow(typeof(SystemMgrEditor));
        // window.position = new Rect(0, 0, 800, 600);
    }
}